find derivative using matlab builtin function